﻿@{
    if (!Check.CheckLogin(false))
    {
        Response.Write("{}");
        Response.End();
    }
    else
    {
        string flowid = Request.QueryString["flowid"];
        string type = Request.QueryString["type"];
        if(!flowid.IsGuid())
        {
            Response.Write("{}");
            Response.End();
        }
        var flow = new Business.Platform.WorkFlow().Get(flowid.ToGuid());
        if(flow==null)
        {
            Response.Write("{}");
            Response.End();
        }
        else
        {
            Response.Write("0" == type ? flow.RunJSON : flow.DesignJSON);
            Response.End();
        }
    }
}